package cn.itcast.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum CollegeStatusEnum {
    YES(1, "是"),
    NO(0, "否");
    
    private final Integer code;
    private final String desc;
    
    public static Integer getCodeByDesc(String desc) {
        for (CollegeStatusEnum value : values()) {
            if (value.desc.equals(desc)) {
                return value.code;
            }
        }
        return null;
    }
}